import http from 'wechat-http'

http.baseURL = 'https://live-api.itheima.net'

http.intercept.response = (res) => {
  console.log()
  if (res.data.code === 10000) {
    return res.data.data
  } else {
    return wx.utils.toast()
  }
}
http.intercept.request = (options) => {
  return options
}

wx.http = http

export default http
